from waveapi import events
from waveapi import model
from waveapi import robot


def OnBlipSubmitted(properties, context):
    blip = context.GetBlipById(properties['blipId'])
    text = blip.GetDocument().GetText()
    blip.GetDocument().SetText('Ee ar lah ' + text + '\n\nShine!')


if __name__ == '__main__':
    myRobot = robot.Robot('shinebot', image_url='http://shinebot.appspot.com/icon/shine.png', version='2.0.3', profile_url='http://shinebot.appspot.com/')
    myRobot.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted)

    myRobot.Run()
